package mock

import "fmt"

type Retriever struct {
	Content string
}

func (r *Retriever) String() string { //这个直接就能被执行是否相当于php类中的初始化函数
	return fmt.Sprintf("Retriever: {Contents=%s}", r.Content) }

func (r *Retriever) Post(url string, from map[string]string) string {
	r.Content = from["contents"]
	return "ok"
}

func (r *Retriever) Get(url string) string {
	return r.Content
}

